<template>
    <div>
                <mu-appbar style="width: 100%;" title="组织管理" color="primary">  
                <mu-button icon slot="left" to="/adminLogin">
                <mu-icon value="arrow_back"></mu-icon>
                </mu-button>
                <mu-button flat slot="right"><mu-icon value="home"></mu-icon></mu-button>
                </mu-appbar>
       <el-table
    :data="Data"
    style="width: 100%">
    <el-table-column type="expand">
      <template slot-scope="props">
        <el-form label-position="left" inline class="demo-table-expand">
           <el-form-item label="联系电话">
            <span>{{ props.row.phone }}</span>
          </el-form-item>
          <el-form-item label="认证状态">
            <span v-if="props.row.renzheng.status===3">已认证</span>
            <span v-if="props.row.renzheng.status===0">未认证</span>
            <span v-if="props.row.renzheng.status===1">审核中</span>
          </el-form-item>
          <el-form-item label="组织负责人">
            <span>{{ props.row.renzheng.Zname }}</span>
          </el-form-item>
          <el-form-item label="负责人证件">
            <span>{{ props.row.renzheng.number }}</span>
          </el-form-item>
          <el-form-item label="手持证件照">
            <img :src= props.row.renzheng.idcard style="height:200px;width:250px">
          </el-form-item>


        </el-form>
      </template>
    </el-table-column>
    <el-table-column
      label="组织名称"
      prop="name"
      width=90px
      >
    </el-table-column>
    <el-table-column
      label="所属高校"
      prop="cname"
      min-width>
    </el-table-column>

<el-table-column  label="操作" >
<template slot-scope="scope">
<mu-button @click="handledelete(scope.$index, scope.row)" color="error" flat small>删除</mu-button>
</template>
</el-table-column>
  </el-table>
 
    </div>
</template>
<script>
import axios from "axios";
import Toast from 'muse-ui-toast';
export default {
    data(){
        axios.get('/api/user/getallO').then(result=>{
            if(result){
              this.Data=result.data
            }else{
                console.log('数据为空')
            }
        })
return{

    Data: []
}


    },
     methods: {

      handledelete(index, row) {
        console.log(index, row);
        
              axios.post("/api/user/delete",{data:row}).then(result=>{
            if(result.data=="删除成功"){
                Toast.success("操作成功")
                          
            }else{
                Toast.success("操作失败")
                console.log("失败")
            }
        })
      },

    }

}
</script>
<style>
  .demo-table-expand {
    font-size: 0;
  }
  .demo-table-expand label {
    width: 90px;
    color: #99a9bf;
  }
  .demo-table-expand .el-form-item {
    margin-right: 0;
    margin-bottom: 0;
    width: 100%;
  }
</style>